﻿Public Class ThongTinNguoiChoThue

    Private Sub ThongTinNguoiChoThue_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim bang As DataTable = NhaChoThue_BUS.loadDuLieuComBoxNguoiChoThue()
        cmbLoaiNha.DataSource = bang
        cmbLoaiNha.DisplayMember = "TenLoaiNhaChoThue"
        cmbLoaiNha.ValueMember = "MaLoaiNha"
    End Sub

    Private Sub btnThem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThem.Click
        Dim NguoiChoThue As New NguoiChoThue_DTO()

        NguoiChoThue.DiaChiChothue = txtDiaChi.Text
        NguoiChoThue.DienThoaiChoThue = txtDienThoai.Text
        NguoiChoThue.SoNguoiO = txtSoNguoiO.Text
        NguoiChoThue.TenNguoiChoThue = txtHoTen.Text.Trim()
        NguoiChoThue.TieuDe = txtTieuDe.Text
        NguoiChoThue.GiaChothue = txtGiaChoThue.Text
        NguoiChoThue.MieuTaNha = txtMieuTaNha.Text
        NguoiChoThue.MaLoaiNha = cmbLoaiNha.SelectedValue
        NhaChoThue_BUS.ThemDuLieu(NguoiChoThue)
        txtDiaChi.Clear()
        txtDienThoai.Clear()
        txtGiaChoThue.Clear()
        TxtSoNguoiO.Clear()
        txtTieuDe.Clear()
        txtMieuTaNha.Clear()
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub
End Class